home *** CD-ROM | disk | FTP | other *** search
- Path: news.callamer.com!news@twizzler.callamer.com
- From: ryost@fix.net (Ron Yost)
- Newsgroups: comp.lang.c++
- Subject: Q: C++ read comma delim. text file & parse How?
- Date: Wed, 10 Apr 1996 17:02:48 GMT
- Organization: Flying Frog Productions
- Distribution: world
- Expires: 2
- Message-ID: <316be5bd.148077@news.fix.net>
- Reply-To: ryost@fix.net
- NNTP-Posting-Host: fix16.fix.net
- X-Newsreader: Forte Agent .99c/16.141
-
- Hi all,
- I'm new to C++ (BC++ 4.52) and have old 'legacy' prg I need to port to C++.
- I have ascii text files that serve as 'look up tables' for conversion routines,
- to re-map (transpose) MIDI note numbers in a standard MIDI song file, and need
- to read in comma delimited data and ignore comments after each line.
-
- They're organized like this:
-
- ** MIDIMAP DATA ** < Header; to make sure file is correct.
- 144,56,145,78 comments <Want to read the 4 numbers in each row
- 145,34,144,45 comments <and parse the documentary comments
- 145,78,146,78 comments <after the rows. The comments are 35 chars max.
- 146,34,145,56 comments <The data represents channel, note number.
-
- The files are 96 rows long, with four columns of numbers. I know I'll have to
- convert the numbers from text to real numbers. These are to be read into 4
- separate arrays, which will use the same index.
-
- Each row represents one MIDI note;
- First two numbers are an existing MIDI channel number and note number, say
- 144,56.
- Second two numbers are what to change that to, say 145,78
-
- This came from GFA Basic on an Atari ST, and I used the RIGHT$ function in basic
- to parse the comments, but how in C++?? Sorry if this seems simple and stupid!!
-
- Any help would be appreciated! THANKS a bunch!
-
- Ron Yost <ryost@fix.net>
- Paso Robles, CA
-